package com.minimalist.lindi.service;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.lindi.po.LindiTradeApplicationConfirmLetter;
import com.minimalist.common.entity.lindi.vo.tradeapplicationconfirmletter.LindiTradeApplicationConfirmLetterQueryVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationconfirmletter.LindiTradeApplicationConfirmLetterVO;
import com.mybatisflex.core.service.IService;

import java.util.List;

/**
 * 林地指标交易平台_交易申请确认函 服务层。
 *
 * @author 11987
 * @since 2025-06-06
 */
public interface LindiTradeApplicationConfirmLetterService extends IService<LindiTradeApplicationConfirmLetter>{

    /**
     * 添加交易申请确认函
     *
     * @param tradeApplicationConfirmLetterVO 交易申请确认函VO
     */
    void addTradeApplicationConfirmLetter(LindiTradeApplicationConfirmLetterVO tradeApplicationConfirmLetterVO);

    /**
     * 根据ID删除交易申请确认函
     *
     * @param confirmLetterId 确认函ID
     */
    void deleteTradeApplicationConfirmLetterByConfirmLetterId(Long confirmLetterId);

    /**
     * 根据ID更新交易申请确认函
     *
     * @param tradeApplicationConfirmLetterVO 交易申请确认函VO
     */
    void updateTradeApplicationConfirmLetterByConfirmLetterId(LindiTradeApplicationConfirmLetterVO tradeApplicationConfirmLetterVO);

    /**
     * 分页查询交易申请确认函列表
     *
     * @param queryVO 查询条件
     * @return 分页结果
     */
    PageResp<LindiTradeApplicationConfirmLetterVO> getPageTradeApplicationConfirmLetterList(LindiTradeApplicationConfirmLetterQueryVO queryVO);

    /**
     * 根据ID查询交易申请确认函
     *
     * @param confirmLetterId 确认函ID
     * @return 交易申请确认函VO
     */
    LindiTradeApplicationConfirmLetterVO getTradeApplicationConfirmLetterByConfirmLetterId(Long confirmLetterId);

    /**
     * 根据交易申请ID查询当前确认函
     *
     * @param tradeApplicationId 交易申请ID
     * @return 交易申请确认函VO
     */
    LindiTradeApplicationConfirmLetterVO getTradeApplicationConfirmLetterByTradeApplicationId(Long tradeApplicationId);

    /**
     * 根据确认函ID查询交易申请确认函列表
     *
     * @param confirmLetterId 确认函ID
     * @return 交易申请确认函列表
     */
    List<LindiTradeApplicationConfirmLetter> getTradeApplicationConfirmLetterListByConfirmLetterId(Long confirmLetterId);

    /**
     * 根据交易申请ID查询交易申请确认函列表
     *
     * @param tradeApplicationId 交易申请ID
     * @return 交易申请确认函列表
     */
    List<LindiTradeApplicationConfirmLetterVO> getTradeApplicationConfirmLetterListByTradeApplicationId(Long tradeApplicationId);

    /**
     * 生成确认函
     *
     * @param tradeApplicationId 交易申请ID
     * @param confirmLetterType  确认函类型
     * @param createId           创建人ID
     * @param tenantId           租户ID
     * @return 确认函VO
     */
    LindiTradeApplicationConfirmLetterVO generateConfirmLetter(Long tradeApplicationId
            , String confirmLetterType, Long createId, Long tenantId);

    /**
     * 删除交易申请确认函文件
     *
     * @param fileId 文件ID
     */
    void deleteTradeApplicationConfirmLetterFileByFileId(Long fileId);
}
